package net.wanho.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * Author：汤小洋
 * Date：2023-11-06 15:00
 * Description：<描述>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName= "student")
public class Student implements Serializable {
    @Id // 主键
    @Field(type = FieldType.Keyword) // id类型为keyword，不会进行分词
    private Integer id;

    @Field(type = FieldType.Text) // text类型会进行分词
    private String name;

    @Field(type = FieldType.Integer) // Integer类型不会进行分词
    private Integer age;

    @Field(type = FieldType.Keyword) // keyword类型不会进行分词
    private String sex;

    @Field(type = FieldType.Text) // text类型会进行分词
    private String school;
}
